package codeRandomThoughts.Test674最长连续递增序列;

//贪心写法
public class Solution2 {
    public int findLengthOfLCIS(int[] nums) {
        int maxLen = 1;
        int currLen = 1;

        for (int i = 0; i < nums.length; i++) {
            if (i == 0) {
                currLen = 1;
            } else {
                if (nums[i] > nums[i - 1]) {
                    currLen++;
                    if (currLen > maxLen) {
                        maxLen = currLen;
                    }
                } else {
                    currLen = 1;
                }
            }
        }

        return maxLen;
    }
}
